/ Assembly List / LJCNetCommon / NetCommon / GetByte

Namespace - LJCNetCommon


Parameters
value - The value object.

Returns

The byte value or the byte default if the object is null. Also returns false if the object is not type "byte".

Syntax

C#
public static Byte GetByte(Object value)

Gets a byte value from an object.

Example

C#
using LJCNetCommon;

// Gets a byte value from an object.
private static void GetByte()
{
    // Simulates an Object value like that received from a DataTable.
    byte setup = Convert.ToByte('A');
    object obj = setup;

    // Gets a byte value from an object.
    byte value = NetCommon.GetByte(obj);
    var result = value.ToString();
    
    // result:
    // 65
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.